<!-- banner配置详情 -->
<template>
  <a-modal
    v-model:visible="vdata.visible"
    :title="'客户明细'"
    :body-style="{ paddingBottom: '80px' }"
    :maskClosable="false"
    width="40%"
    :close="onClose"
    :footer="null"
  >
    <div style="margin-bottom: 20px;font-size: 18px;font-weight: 600;">客户信息</div>
    <a-row justify="space-between" type="flex">
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="客户唯一标识">
            {{ vdata.detailData.openId || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="昵称">
            {{ vdata.detailData.nickName || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="真实姓名">
            {{ vdata.detailData.cstmName || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="手机号码">
            {{ vdata.detailData.phone || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="是否实名">
            <template v-if="vdata.detailData.isAustState === 0">已实名</template>
            <template v-else>未实名</template>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="实名认证唯一标识">
            {{ vdata.detailData.cstmNo || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="生日">
            {{ vdata.detailData.birthday || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="性别">
            <span v-if="vdata.detailData.sex == 0">未知</span>
            <span v-if="vdata.detailData.sex == 1">男</span>
            <span v-if="vdata.detailData.sex == 2">女</span>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="首次登录小程序时间">
            {{ vdata.detailData.firstEntryTime || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="12">
        <a-descriptions>
          <a-descriptions-item label="归属机构">
            {{ vdata.detailData.agentName || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
    </a-row>
    <div style="margin-bottom: 20px;font-size: 18px;font-weight: 600;">其他信息</div>

    <a-row v-if="vdata.detailData.ffqyState==2" justify="space-between" type="flex" style="margin-top: 20px;">
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="是否498老客户">否</a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="是否完成历史福分迁移"> 否</a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="历史福分迁移值">0</a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="498老客归属关系">--</a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="老客焕醒活动归属">-- </a-descriptions-item>
        </a-descriptions>
      </a-col>
    </a-row>


    <a-row v-else justify="space-between" type="flex" style="margin-top: 20px;">
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="是否498老客户">是    </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="是否完成历史福分迁移">
            <template v-if="vdata.detailData.ffqyState == 0">是</template>
            <template v-if="vdata.detailData.ffqyState == 1">否</template>
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="历史福分迁移值">
            {{ vdata.detailData.score || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="498老客归属关系">
            {{ vdata.detailData.oldAgentNo || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
      <a-col :sm="24">
        <a-descriptions>
          <a-descriptions-item label="老客焕醒活动归属">
            {{ vdata.detailData.agentNo || "--" }}
          </a-descriptions-item>
        </a-descriptions>
      </a-col>
    </a-row>
  </a-modal>
</template>

<script lang="ts" setup>

import {reactive, getCurrentInstance, ref,} from 'vue'


const {$infoBox} = getCurrentInstance()!.appContext.config.globalProperties

// 接受父组件传递的props
const props = defineProps({
  dataRecord: {
    type: Object,
    default: {}
  }
})

const vdata: any = ref({
  visible: false,
  detailData: {}
})


 function show(dataRecord) {
   vdata.value.detailData = dataRecord
   console.log('show', vdata.value.detailData)
   console.log('show', vdata.value.detailData.openId)
     vdata.value.visible = true
}

function onClose() {
  vdata.value.visible = false
}


defineExpose({
  show, //抛出show函数给父组件
})
</script>
<style scoped>
.ant-table-wrapper {
  margin: 0;
}

</style>
